package com.birdboot.core;

import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;

/**
 * 该线程任务负责与指定客户端进行一次HTTP交互
 *
 * 1:解析请求
 * 2:处理请求
 * 3:回复响应
 *
 */
public class ClientHandler implements Runnable{
    private Socket socket;
    public ClientHandler(Socket socket){
        this.socket = socket;
    }
    public void run() {
        try {
            //1解析请求
            InputStream in = socket.getInputStream();
            int d;
            while( (d = in.read()) != -1    ){
                System.out.print((char)d);
            }





        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
